package week0401;
import java.util.Scanner;
public class Main8 {
	private static Scanner in;
	public static void main(String[] args) {
		in=new Scanner(System.in);
		while(true){
			int n=in.nextInt();
			double[] value=new double[n];
			for (int i = 0; i < n; i++) {
				value[i]=in.nextDouble();
			}
			System.out.println(ArrayUtils.findMinMax(value));
			System.out.println(ArrayUtils.PairResult.class);
		}
	}

}

class ArrayUtils{
	public static class PairResult{
		 private double min;
		 private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		public double getMin() {
			return min;
		}
		public void setMin(double min) {
			this.min = min;
		}
		public double getMax() {
			return max;
		}
		public void setMax(double max) {
			this.max = max;
		}
		public PairResult() {
			min=Double.MAX_VALUE;
			max=Double.MIN_VALUE;
		}	
	}
	public static PairResult findMinMax(double[] values){
		ArrayUtils.PairResult pair=new ArrayUtils.PairResult();
		for (double d : values) {
			if(pair.getMin()>d) pair.setMin(d);
			if(pair.getMax()<d) pair.setMax(d);
		}
		return pair;
	}
	
}